# Maintainer: Alexey Pavlov <Alexpux@gmail.com>

pkgname=tig
pkgver=2.5.1
pkgrel=1
pkgdesc='Text-mode interface for Git'
depends=('git' 'libreadline' 'ncurses')
makedepends=('asciidoc' 'xmlto' 'libreadline-devel' 'ncurses-devel' 'libiconv-devel')
url='https://jonas.github.io/tig/'
license=('GPL')
arch=('i686' 'x86_64')
source=("https://github.com/jonas/${pkgname}/releases/download/${pkgname}-${pkgver}/${pkgname}-${pkgver}.tar.gz")
sha256sums=('500d5d34524f6b856edd5cae01f1404d14f3b51a9a53fd7357f4cebb3d4c9e64')

prepare() {
  cd "${srcdir}/${pkgname}-${pkgver}"
}

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  ./configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --localstatedir=/var \
    --build=${CHOST}
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  make DESTDIR="${pkgdir}" install install-doc-man
  install -Dm0644 contrib/tig-completion.bash "${pkgdir}/usr/share/bash-completion/completions/tig"
}
